/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sh.ndt.exam.service;

import com.sh.ndt.common.service.EmailServiceImpl;
import com.sh.ndt.exam.dao.ExamDAO;
import com.sh.ndt.exam.entity.ExamHistory;
import com.sh.ndt.exam.entity.TestHistory;
import com.sh.ndt.exception.DAOException;
import com.sh.ndt.exception.ServiceException;
import java.util.List;
import java.util.logging.Level;
import org.apache.log4j.Logger;

/**
 *
 * @author Prashanth
 */
public class ExamServiceImpl implements ExamService {

    private static final Logger LOGGER = Logger.getLogger(EmailServiceImpl.class);
    private ExamDAO examDao;

    public ExamServiceImpl() {
        LOGGER.debug("Constructed ExamServiceImpl............");
    }

    public ExamServiceImpl(ExamDAO examDao) throws ServiceException {
        try {
            LOGGER.debug("*************** Inside QuestionServiceImpl Constructor ***************");
            this.examDao = examDao;

        } catch (Exception e) {
            throw new ServiceException(e);
        }
    }

    @Override
    public List<TestHistory> getTestHistoryList(long userId, long testId) throws ServiceException {
        try {
            return examDao.getTestHistoryList(userId,testId);
        } catch (Exception e) {
            throw new ServiceException(e);
        }
    }

    @Override
    public List<ExamHistory> getExamHistoryList(long userId, long examId) throws ServiceException {
        try {
            return examDao.getExamHistoryList(userId,examId);
        } catch (Exception e) {
            throw new ServiceException(e);
        }
    }

}
